package com.zhisuo.apicenter.model;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class DeliveryOrderRowMapper implements RowMapper<DeliveryOrder> {

    @Override
    public DeliveryOrder mapRow(ResultSet rs, int rowNum) throws SQLException {
        DeliveryOrder deliveryOrder = new DeliveryOrder();
        deliveryOrder.setUserid(rs.getInt("userid"));
        deliveryOrder.setId(rs.getInt("id"));
        deliveryOrder.setCarid(rs.getInt("carid"));
        deliveryOrder.setBoxid(rs.getInt("boxid"));
        deliveryOrder.setBoxcode(rs.getString("boxcode"));
        deliveryOrder.setPaymentcode(rs.getString("paymentcode"));
        deliveryOrder.setPaymentcompany(rs.getString("paymentcompany"));
        deliveryOrder.setReceiptusername(rs.getString("receiptusername"));
        deliveryOrder.setCreate_time(rs.getTimestamp("create_time"));
        deliveryOrder.setStatus(rs.getInt("status"));
        deliveryOrder.setReceiptusermobile(rs.getString("receiptusermobile"));
        deliveryOrder.setReceiptuseraddressid(rs.getInt("receiptuseraddressid"));
        deliveryOrder.setReceiptuseraddresscode(rs.getString("receiptuseraddresscode"));
        deliveryOrder.setReceiptcode(rs.getString("receiptcode"));
        deliveryOrder.setReceiptuserorderstarttime(rs.getTimestamp("receiptuserorderstarttime"));
        deliveryOrder.setReceiptuserorderendtime(rs.getTimestamp("receiptuserorderendtime"));
        deliveryOrder.setReceipt_time(rs.getTimestamp("receipt_time"));
        deliveryOrder.setOrdertype(rs.getInt("ordertype"));
        deliveryOrder.setReceiptuserbuildid(rs.getInt("receiptuserbuildid"));
        deliveryOrder.setIsovertime(rs.getInt("isovertime"));
        return deliveryOrder;
    }

}
